﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Collections;
using System.Windows.Forms;
using XISoft.AppCreator.Util.Common;

namespace XISoft.AppCreator.Util.ConfigHelper.TplConfig
{
    public static class TplEngineConfig
    {

        private static ConfigHelper<TplEngineConfigElement> config =new ConfigHelper<TplEngineConfigElement>( Application.StartupPath + "\\Config\\TplConfig.config");

        public static TplEngineConfigElement GetConfig(String key)
        {
            foreach (TplEngineConfigElement tpl in config.Elements)
                if (key.Equals(tpl.TplName))
                    return tpl;
            throw new Exception("tplConfig no Found " + key);
        }
        public static String[] GetTplNameList()
        {
            String[] tplNameList = new String[config.Elements.Count];
            for (int i = 0; i < config.Elements.Count; i++)
            {
                tplNameList[i] = config.Elements[i].TplName;
            }
            return tplNameList;
        }
    }
}
